Fix ChunkBlock top ten showing AOneBlock players - #16
Merged
Conversation
Both AOneBlock and ChunkBlock use OneBlockIslands as their database class name. BentoBox's JSON handler keys on getSimpleName(), so both game modes share the same database/OneBlockIslands/ folder. When TopBlock refreshes ChunkBlock's data, handler.loadObjects() returns all records including AOneBlock's, causing AOneBlock players to appear in the ChunkBlock panel. Fix by filtering islands in refresh() with hook.getGameMode().inWorld(island.getWorld()) so only islands belonging to the correct game mode are included. Also guard the panel icon path against customised templates where icon: PLAYER_HEAD is uncommented — builder.icon(ItemStack) does not set playerHeadName, so HeadGetter was never invoked and heads stayed as Steve. Additionally, catch LinkageError in onEnable() when constructing game mode hooks, and add softdepend entries in plugin.yml for the Pladdon plugin names so class loading works across plugin loaders. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WwpMcJAhXEWeFwtRwg1uNy
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
OneBlockIslandsas their database class name. BentoBox's JSON handler usesgetSimpleName()to determine storage, so both sharedatabase/OneBlockIslands/. Added ahook.getGameMode().inWorld(island.getWorld())filter inrefresh()so only islands from the correct game mode appear in each top ten.top_panel.ymlhasicon: PLAYER_HEADuncommented,builder.icon(ItemStack)doesn't setplayerHeadName, soHeadGetterwas never invoked. Now skips PLAYER_HEAD template icons and falls through to the name-based head path.LinkageErrorinonEnable()when constructing hooks, and addssoftdependentries inplugin.ymlfor game mode Pladdon names so class loading works across plugin loaders.Test plan
testRefreshFiltersIslandsFromWrongGameModeverifies islands from a different game mode's world are excluded/chunkblock topblockshows only ChunkBlock players🤖 Generated with Claude Code
https://claude.ai/code/session_01WwpMcJAhXEWeFwtRwg1uNy